package com.hqyj.mana.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hqyj.mana.enums.ResultEnum;
import com.hqyj.mana.pojo.HrManagement;
import com.hqyj.mana.pojo.vo.ResultVO;
import com.hqyj.mana.service.PositionService;
import com.hqyj.mana.service.UserManagementService;

@RestController
@RequestMapping("management")
public class UserManagementController {
	@Autowired
	private UserManagementService userManagementService;
	@RequestMapping("userIdentity.do")
	public ResultVO userIdentity(String roleId,String userId){
		int list = userManagementService.changeIdentity(roleId,userId);
		ResultVO resultVO = new ResultVO();
		resultVO.setData(list);
		if(list == 0){
			resultVO.setCode(ResultEnum.PARAM_ERROR.getCode());
			resultVO.setMsg(ResultEnum.PARAM_ERROR.getMessage());
			return resultVO;
		}	
		resultVO.setCode(ResultEnum.SUCCESS.getCode());
		resultVO.setMsg(ResultEnum.SUCCESS.getMessage());
		
		return resultVO;
	}
}
